﻿using System;
using System.Collections.Generic;
using BotonJXC.Entity;
using InvoiceTypeDAO = BotonJXC.DAO.InvoiceTypeDAO;
using BotonJXC.Util;
using NHibernate.Criterion;

namespace BotonJXC.BLL
{
    public class InvoiceTypeBLL : BaseBLL<InvoiceTypeDAO, InvoiceType, int>
    {
        public InvoiceTypeBLL()
        {
        }

        public PageModel<InvoiceType> Find(string invoiceTypeName, int start, int count)
        {
            List<ICriterion> criterions = new List<ICriterion>();
            if (!string.IsNullOrEmpty(invoiceTypeName))
            {
                criterions.Add(Restrictions.Like("InvoiceTypeName", invoiceTypeName, MatchMode.Anywhere));
            }
            return Dao.FindByPage(criterions.ToArray(), null, start, count);
        }
        public IList<InvoiceType> findInvoiceTypes()
        {
            return Dao.Find();
        }
    }
}